package com.ruoyi.bzjgl.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.bzjgl.domain.LegalBankBasic;
import com.ruoyi.bzjgl.service.ILegalBankBasicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 【请填写功能名称】Controller
 * 
 * @author ruoyi
 * @date 2024-01-26
 */
@RestController
@RequestMapping("/system/basic")
public class LegalBankBasicController extends BaseController
{
    @Autowired
    private ILegalBankBasicService legalBankBasicService;

    /**
     * 查询【请填写功能名称】列表
     */
//    @PreAuthorize("@ss.hasPermi('system:basic:list')")
    @GetMapping("/list")
    public TableDataInfo list(LegalBankBasic legalBankBasic)
    {
        startPage();
        List<LegalBankBasic> list = legalBankBasicService.selectLegalBankBasicList(legalBankBasic);
        return getDataTable(list);
    }


    /**
     * 获取【请填写功能名称】详细信息
     */
//    @PreAuthorize("@ss.hasPermi('system:basic:query')")
    @GetMapping(value = "/{yhbh}")
    public AjaxResult getInfo(@PathVariable("yhbh") String yhbh)
    {
        return success(legalBankBasicService.selectLegalBankBasicByYhbh(yhbh));
    }

    /**
     * 新增【请填写功能名称】
     */
//    @PreAuthorize("@ss.hasPermi('system:basic:add')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody LegalBankBasic legalBankBasic)
    {
        return toAjax(legalBankBasicService.insertLegalBankBasic(legalBankBasic));
    }

    /**
     * 修改【请填写功能名称】
     */
//    @PreAuthorize("@ss.hasPermi('system:basic:edit')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody LegalBankBasic legalBankBasic)
    {
        return toAjax(legalBankBasicService.updateLegalBankBasic(legalBankBasic));
    }

    /**
     * 删除【请填写功能名称】
     */
//    @PreAuthorize("@ss.hasPermi('system:basic:remove')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
	@DeleteMapping("/{yhbhs}")
    public AjaxResult remove(@PathVariable String[] yhbhs)
    {
        return toAjax(legalBankBasicService.deleteLegalBankBasicByYhbhs(yhbhs));
    }
}
